﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace SharePointListSync
{
    public class ConnectionManager
    {

        [DllImport("wininet.dll", SetLastError = true)]
        extern static bool InternetGetConnectedState(out Int32 dwflags, Int32 dwReserved);

        public static bool isOnline()
        {
            int flags;
            bool isConnected = InternetGetConnectedState(out flags, 0);
            return isConnected;
        }

        //public static bool isOnline(out ConnectionStates connectionStates)
        //{
        //    int flags;
        //    bool isConnected = InternetGetConnectedState(out flags, 0);


        //}

    }
}
